<!DOCTYPE html>
<html>

<head>
    <meta charset="utf-8">
    <title>Example</title>
</head>

<body>
    <script type="text/javascript">
    var myData = {
        name: "Adam",
        city: null,
    };

    if (!myData.name) {
        document.writeln("name IS null or undefined");
    } else {
        document.writeln("name IS NOT null or undefined");
    }

    if (!myData.city) {
        document.writeln("city IS null or undefined");
    } else {
        document.writeln("city IS NOT null or undefined");
    }
    </script>
</body>

</html>
